import { Base } from "./base";

export class Cache extends Base {
  /**
   *
   * @param name
   * @param module
   * @param pageNum
   * @param pageSize
   * @returns {Promise<void>}
   */
  // eslint-disable-next-line camelcase
  async list() {
    const { data = [] } = await this.$http("post", "/api/cache", {});
    return data;
  }

  async del(key) {
    const { errno } = await this.$http("post", "/api/cache/del", { key });
    return errno === 0;
  }
}
